package com.android.takegism.utils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;

public class SensorPackage implements Serializable {
    String dataType="";
    HashMap<String,Object> data = new HashMap<>();
    String dataString = "";

    public String getDataString() {
        return dataString;
    }

    public void setDataString(String dataString) {
        this.dataString = dataString;
    }

    public Object get(String key){
        return data.get(key);
    }

    public Object getOrDefault(String key){
        return data.getOrDefault(key,"null");
    }
    public Object getOrDefault(String key,Object defaultValue){
        return data.getOrDefault(key,defaultValue);
    }
    public SensorPackage() {
    }

    public SensorPackage(String dataType) {
        this.dataType = dataType;
    }

    @Override
    public String toString() {
        return "SensorPackage{" +
                "dataType='" + dataType + '\'' +
                ", data=" + data +
                ", dataString='" + dataString + '\'' +
                '}';
    }

    public void put(String key, Object val){
        data.put(key,val);
    }
    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public HashMap<String, Object> getData() {
        return data;
    }

    public void setData(HashMap<String, Object> data) {
        this.data = data;
    }
}
